<?php

if (!isset($_GET['id'])) header("Location: kemikalije.php");

$id = $_GET['id'];

$query = "SELECT * FROM kemikalija WHERE id=" . $id . ";";

$result = myQuery($query);

if (! ($row = mysql_fetch_array($result))) header("Location: kemikalije.php");

$proizvodjaci = atributiKemikalijaToString("proizvodjac", $row['id']);
$odjeli = atributiKemikalijaToString("odjel", $row['id']);
$hazardi = atributiKemikalijaToString("hazard", $row['id']);
$otapala = atributiKemikalijaToString("otapalo", $row['id']);
$sinonimi = getSinonimiToString($row['id']);
?>


<table>
<tr>
<td width='50%'>
<div class='content'>
<span class='contentTitle'> Opće informacije</span>
<table class='tableResult' cellspacing='0' width='100%'>
	<tr> 
		<th scope='row' class='spec' width='110px' > Naziv </th>
		<td> 
			<?php print($row['naziv']);?> 
		</td> 
	</tr>

	<tr> 
		<th scope='row' class='spec' > Molekularna<br>formula </th> 
		<td> 
			<?php print($row['formula']);?>
		</td> 
	</tr>
				
	<tr> 
		<th scope='row' class='spec' > Molekularna<br>masa </th> 
		<td> 
			<?php print($row['masa']);?> g/mol 
		</td> 
	</tr>
						
	<tr> 
		<th scope='row' class='spec' > Sinonimi </th> 
		<td >  
			<?php print($sinonimi); ?>
		</td> 
	</tr>
	
	</table>
	</div>
</td>

<td rowspan='3' valign="top">
	<div class='content'>
	<span class='contentTitle'> Sigurnosne informacije </span>
	<table class='tableResult' cellspacing='0' width='100%'>
	<tr> 
		<th scope='row' class='spec' > Info </th> 
		<td> 
			<?php print($row['info']); ?>
		</td>
	</tr>
	
	<tr> 
		<th scope='row' class='spec' > Info o <br>spremanju </th> 
		<td> 
			<?php print($row['pohrana']); ?>
		</td>
	</tr>
	
	<tr>
		<th scope='row' class='spec' width='90px'> Hazard<br>kodovi </th> 
		<td>
			<?php print($hazardi); ?>
		</td> 
	</tr>
			
	<tr> 
		<th scope='row' class='spec'> Zaštitna oprema </th> 
		<td> 
			<?php print($row['oprema'])?>
		</td> 
	</tr>
			
	<tr> 
		<th scope='row' class='spec'> Rizik </th> 
		<td> 
			<?php print($row['rizik'])?>
		</td>
	</tr>
			
	<tr> 
		<th scope='row' class='spec'> Sigurnost </th> 
		<td> 
			<?php print($row['sigurnost'])?>
		</td>
	</tr>
			
	<tr> 
		<th scope='row' class='spec'> Prva<br>pomoć </th> 
		<td> 
			<?php print($row['pomoc'])?>
		</td>
	</tr>
	</table>
	</div>
</td>
</tr>

<tr>
<td>
	<div class='content'>
	<span class='contentTitle'> Svojstva kemikalije</span>
	<table class='tableResult' cellspacing='0' width='100%'>
			
	<tr> 
		<th scope='row' class='spec' width='110px'> Gustoća </th> 
		<td>
			<?php print($row['gustoca'])?> g/cm3 pri <?php print($row['gustoca_dodatak'])?> °C
		</td> 
	</tr>
				
	<tr> 
		<th scope='row' class='spec' > Zapaljenje </th> 
		<td> 
			<?php print($row['samozapaljenje']); ?> °C 
		</td> 
	</tr>
				
	<tr> 
		<th scope='row' class='spec' > Ključanje </th> 
		<td> 
			<?php print($row['kljucanje']); ?> °C 
		</td>
	</tr>
				
	<tr> 
		<th scope='row' class='spec' > Otapanje </th> 
		<td> 
			<?php print($row['otapanje']); ?> °C
		</td>
	</tr>
				
	<tr> 
		<th scope='row' class='spec' > Kemijska čistoća </th> 
		<td> 
			<?php print($row['cistoca']); ?>
		</td> 
	</tr>
				
	<tr> 
		<th scope='row' class='spec' > Otapala </th> 
		<td> 
			<?php print($otapala); ?>
		</td> 
	</tr>
	</table>
	</div>
</td>
</tr>

<tr>
<td>
	<div class='content'>
	<span class='contentTitle'> Pohrana i narudžba </span>
	<table class='tableResult' cellspacing='0' width='100%'>
	<tr> 
		<th scope='row' class='spec' > Cat number </th> 
		<td> 
			<?php print($row['cat']); ?>
		</td> 
	</tr>
			
	<tr> 
		<th scope='row' class='spec' > Proizvođači </th> 
		<td> 
			<?php print($proizvodjaci); ?>
		</td> 
	</tr>
			
	<tr> 
		<th scope='row' class='spec' > Spremanje<br>na odjelu </th> 
		<td> 
			<?php print($odjeli); ?> 
		</td> 
	</tr>
	</table>
	</div>
</td>
</tr>
</table>
